package com.chinacoal.hr.levelapi.api;

import com.chinacoal.hr.levelapi.api.fallback.CapUserFallback;
import com.chinacoal.hr.levelapi.entity.EmployeeDetailVO;
import com.chinacoal.hr.levelapi.entity.EmployeeVO;
import com.chinacoal.hr.levelapi.util.Result;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "ccms-org", configuration = {FeignAutoConfiguration.class}, fallback = CapUserFallback.class)
public interface CapUserClient {

    @GetMapping({"/org/capUser/employee/userName"})
    public abstract Result<EmployeeVO> findEmpByUserId(@RequestParam("userId") String paramString);

    @GetMapping({"/org/employee"})
    public abstract Result<EmployeeDetailVO> getEmpDetail(@RequestParam("userId") Integer userId, @RequestParam("userName") String userName);

    //根据员工编码查询员工详情信息(包括机构信息和上级机构信息
    @GetMapping("/org/employee/code/{empCode}")
    public Result<List<EmployeeVO>> findEmpByEmpCode(@PathVariable(value = "empCode") String empCode);
}
